# -*- coding: utf-8 -*-
#  @author  Bink
#  @date  2020/9/2 17:58
# @Email : 2641032316@qq.com

import numpy as np
import pandas as pd

# pd.set_option('display.max_columns', None)
# pd.set_option('display.max_rows', None)
# pd.set_option('max_colwidth', 100)

file_subsidy = pd.read_table("D:/pra/Python/python-programming-project/src/resources/train/subsidy_train.txt",
                        dtype=int,
                        delimiter=',',
                        # index_col=0,
                        )

df_subsidy = pd.DataFrame(file_subsidy)
df_subsidy.columns = ['id', 'subsidy']

# print(df.shape)
# print(df.index)
# print(df.columns)
# print(df.count())

# df = df[df.iloc[:, [1]] > 0]
df_subsidy = df_subsidy[df_subsidy['subsidy'] > 0].sort_values(['subsidy', 'id'])

df_subsidy.to_excel("./out/subsidyInfo.xlsx", index=None)
df_subsidy['id'].to_excel("./out/subsidyId.xlsx", index=False)
# print(df[df['subsidy'] > 0].count())

# npf = df.to_numpy()
#
# print(npf)

# print(df[:, df.iloc[:, [1]] > 0])
